<?php
/**
 * @Author:      lyt
 * @DateTime:    2016-02-25 10:45:32
 * @Description: 用于统计的 样式的
 */
class StatisticalClassification extends Eloquent
{
    protected $table = "statistical_classification";
    
    /**
     * @Author:      zwh
     * @DateTime:    2016-6-16 15:33:18
     * @Description: 根据 第三级分类获取一二级分类
     */
    public static function getClassification($st_classifi_id){
        $si_arr=StatisticalClassification::leftJoin("statistical_classification as sc2","sc2.id","=","statistical_classification.parent_id")
        ->leftJoin("statistical_classification as sc","sc.id","=","sc2.parent_id")
        ->where('statistical_classification.id',$st_classifi_id)
        ->select("sc2.id as two_id","sc2.name as two","sc.id as one_id","sc.name as one")->first();
        return $si_arr;
    
    }
}